package com.hhit.zhgd.domain.dto

import javax.validation.constraints.Min
import javax.validation.constraints.NotBlank
import javax.validation.constraints.NotNull
import javax.validation.constraints.Pattern


data class AdminDTO(
    @NotNull(message = "参数错误", groups = [Update::class])
    @Min(value = 1, message = "参数错误", groups = [Update::class])
    var id: Long?,
    @NotBlank(message = "参数错误", groups = [Save::class])
    var username: String?,
    @NotBlank(message = "参数错误", groups = [Save::class])
    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d\\W]{6,18}\$", message = "密码必须包含字母和数字，且在6-18位之间", groups = [Save::class])
    var password: String?,
    @NotBlank(message = "请选择角色", groups = [Update::class])
    var role_ids: String?,
    var status: Int?
) {
    interface Save
    interface Update
}